/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf.views;

import com.openbrew.openbrewrf.PackageType;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "PackageType")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PackageTypeView.findAll", query = "SELECT p FROM PackageTypeView p"),
    @NamedQuery(name = "PackageTypeView.findByPackageTypeID", query = "SELECT p FROM PackageTypeView p WHERE p.packageTypeID = :packageTypeID"),
    @NamedQuery(name = "PackageTypeView.findByPackageTypeDesc", query = "SELECT p FROM PackageTypeView p WHERE p.packageTypeDesc = :packageTypeDesc"),
    @NamedQuery(name = "PackageTypeView.findByPackageTypeVol", query = "SELECT p FROM PackageTypeView p WHERE p.packageTypeVol = :packageTypeVol")})
public class PackageTypeView implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "PackageTypeID")
    private Integer packageTypeID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "PackageTypeDesc")
    private String packageTypeDesc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PackageTypeVol")
    private float packageTypeVol;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PackageNumItems")
    private int numItems;
    @Basic(optional = false)
    @NotNull
    @Column(name = "servingVessel")
    private boolean servingVessel;

    public PackageTypeView() {
    }

    public PackageTypeView(Integer packageTypeID) {
        this.packageTypeID = packageTypeID;
    }

    public PackageTypeView(Integer packageTypeID, String packageTypeDesc, float packageTypeVol) {
        this.packageTypeID = packageTypeID;
        this.packageTypeDesc = packageTypeDesc;
        this.packageTypeVol = packageTypeVol;
    }

    public Integer getPackageTypeID() {
        return packageTypeID;
    }

    public void setPackageTypeID(Integer packageTypeID) {
        this.packageTypeID = packageTypeID;
    }

    public String getPackageTypeDesc() {
        return packageTypeDesc;
    }

    public void setPackageTypeDesc(String packageTypeDesc) {
        this.packageTypeDesc = packageTypeDesc;
    }

    public float getPackageTypeVol() {
        return packageTypeVol;
    }

    public void setPackageTypeVol(float packageTypeVol) {
        this.packageTypeVol = packageTypeVol;
    }

    public int getNumItems() {
        return numItems;
    }

    public void setNumItems(int numItems) {
        this.numItems = numItems;
    }

    public boolean isServingVessel() {
        return servingVessel;
    }

    public void setServingVessel(boolean servingVessel) {
        this.servingVessel = servingVessel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (packageTypeID != null ? packageTypeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PackageType)) {
            return false;
        }
        PackageTypeView other = (PackageTypeView) object;
        if ((this.packageTypeID == null && other.packageTypeID != null) || (this.packageTypeID != null && !this.packageTypeID.equals(other.packageTypeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.PackageTypeView[ packageTypeID=" + packageTypeID + " ]";
    }
}
